package com.apan.redispractice.controller;


import com.apan.redispractice.entity.Address;
import com.apan.redispractice.service.IAddressService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2025-06-24
 */
@RestController
@RequestMapping("/address")
@Tag(name = "地址管理", description = "地址相关操作接口")
public class AddressController {

    @Resource
    IAddressService addressService;

    @GetMapping("/address/{id}")
    @Operation(summary = "获取地址信息", description = "根据ID查询地址详情")
    @Parameter(name = "id", description = "地址唯一标识", required = true, example = "59")
    public Address getAddress(@PathVariable Long id) {
        return addressService.getById(id);
    }


}
